package org.example.core;

import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;

@ServerEndpoint("/ws/v1")
public class WSServer {
    @OnOpen
    public void onOpen(Session session) {
        System.out.println("用户连接");
    }

    @OnMessage
    public void onMessage(String msg) {}

    @OnClose
    public void onClose(Session session) {
        System.out.println("用户关闭");
    }

    @OnError
    public void onError(Throwable t) {
        System.out.println(t);
    }
}
